package com.yanxin.credit.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @program jkstack-dpa
 * @description:
 * @author: LiuYanXin
 * @create: 2021-06-15 11:27
 */
@Getter
@AllArgsConstructor
public enum FilePathEnum {

    // 脚本
    SCRIPT("script"),
    // 头像
    AVATAR("avatar"),
    // jmeter
    JMETER("jmeter"),
    // shell
    SHELL("shell"),
    // app
    APP("app"),

    ;

    private String name;

    public static FilePathEnum getName(String name) {

        return Arrays.stream(FilePathEnum.values())
                .filter(it -> it.getName().equalsIgnoreCase(name))
                .findFirst().orElse(FilePathEnum.SHELL);
    }
}
